package com.eshop.modules.product.service.mapper;

import org.apache.ibatis.annotations.Select;
import com.eshop.modules.product.vo.StoreProductRelationQueryVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Repository;
import com.eshop.modules.product.domain.StoreProductRelation;
import com.eshop.common.mapper.CoreMapper;

@Repository
public interface StoreProductRelationMapper extends CoreMapper<StoreProductRelation>
{
    @Select({ "select B.id pid,A.type as category,B.store_name as storeName,B.price,B.is_integral as isIntegral,B.ot_price as otPrice,B.sales,B.image,B.is_show as isShow,B.integral as integral from store_product_relation A left join store_product B on A.product_id = B.id where A.type=#{type} and A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc" })
    List<StoreProductRelationQueryVo> selectRelationList(final Page page, @Param("uid") final Long uid, @Param("type") final String type);
}
